package fr.generali.accueilclient.gwt.client.ui.components.table.cells;

import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.safehtml.shared.SafeHtmlUtils;
import com.google.gwt.text.shared.AbstractSafeHtmlRenderer;
import com.google.gwt.user.client.ui.RadioButton;

public class RadioCell extends MouseEventAwareEditableCell<Boolean, Boolean, AbstractSafeHtmlRenderer<Boolean>> {

    private static RadioButton radio;

    public RadioCell(final String groupName) {
        super(new AbstractSafeHtmlRenderer<Boolean>() {

            @Override
            public SafeHtml render(Boolean object) {
                radio = new RadioButton(groupName);
                radio.setValue(object);
                return SafeHtmlUtils.fromTrustedString(radio.getElement().getInnerHTML().toString());
            }
        });
    }

}
